//
//  SAStageObjectBuilder.m
//  GameFrame
//
//  Created by Hiroshi Nomura on 2013/11/14.
//  Copyright (c) 2013年 Hiroshi Nomura. All rights reserved.
//

#import "SAStageObjectBuilder.h"

@implementation SAStageObjectBuilder

-(BOOL)buildObject:(SAStageObject*)object filePath:(NSString*)path fileType:(NSString*)type
{
    if (object == nil) {
        return NO;
    }
    
    NSString* filePath		= [[NSBundle mainBundle] pathForResource:path ofType:type];
	NSFileManager*fm		= [NSFileManager defaultManager];
	if (![fm fileExistsAtPath:filePath]) {
		return NO;
	}
    
    NSURL *url      = [NSURL fileURLWithPath:path];
	m_parser        = [[NSXMLParser alloc] initWithContentsOfURL:url];
	[m_parser setDelegate:self];
    
    return YES;
}

@end
